<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Entity.*"%>
<%@page import="Dao.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<link rel="stylesheet"
		href="<%=request.getContextPath()%>/css/myRelease_teacher.css"
		type="text/css"></link>
		<jsp:useBean id="LearningResourceDao" class="Dao.LearningResourceDao"></jsp:useBean>
<a>我的发布</a>
<table class="dataintable">
<tr>
<td align="center">资源ID</td>
			<td align="center">标签</td>
			<td align="center">资源名称</td>
			<td align="center">上传者ID</td>
			<td align="center">上传时间</td>
			<td align="center">文件路径</td>
			<td align="center">点赞数</td>
			<td align="center">简要介绍</td>
			<td align="center"><a
				href="/UniversityResourceSystem/releaseLearningResource.jsp"
				target="_blank"> <input type="button" class="mybutton"
					value="发布学习资源" text-align:right />
			</a></td>
			</tr>
		<%
		List<LearningResource> lrlist=new LearningResourceDao().queryLearningResourceByUploaderID(session.getAttribute("session_userName").toString());
		for(LearningResource lr:lrlist){
		%>
		<tr>
		<td><input type="text" value=<%=lr.getResourceID() %>></td>
		<td><input type="text" value=<%=lr.getLabel() %>></td>
		<td><input type="text" value=<%=lr.getResourceName() %>></td>
		<td><input type="text" value=<%=lr.getUploaderID() %>></td>
		<td><input type="text" value=<%=lr.getUploadTime() %>></td>
		<td><input type="text" value=<%=lr.getFilePath() %>></td>
		<td><input type="text" value=<%=lr.getThumbNumber() %>></td>
		<td><input type="text" value=<%=lr.getBriefIntroduce() %>></td>
		<td><form action="/UniversityResourceSystem/RemoveUploadedFileServlet">
		<input type="hidden" name="status" value="teacher">
			<input type="hidden" name="resourceID" value=<%=lr.getResourceID() %>>
			<input type="hidden" name="filePath" value=<%=lr.getFilePath() %>>
			<input type="submit" value="删除"/>  <!-- 注意：如果用超链接传参，只能是get方法，而tomcat中get方法不支持一些特殊字符：/，\....因此只能post传过去 -->
			</form></td>
		</tr>
		<%} %>
</table>
	<%-- <link rel="stylesheet"
		href="<%=request.getContextPath()%>/css/myRelease_teacher.css"
		type="text/css"></link>
	<jsp:useBean id="CourseResourceDao" class="Dao.CourseResourceDao"></jsp:useBean>
	<a>我的发布</a>
	<table class="dataintable">
		<tr>
			<td align="center">课程ID</td>
			<td align="center">标签</td>
			<td align="center">资源名称</td>
			<td align="center">上传者ID</td>
			<td align="center">上传时间</td>
			<td align="center">文件路径</td>
			<td align="center">简要介绍</td>
			<td align="center"><a
				href="/UniversityResourceSystem/releaseCourseResource.jsp"
				target="_blank"> <input type="button" class="mybutton"
					value="发布精品课程" text-align:right />
			</a></td>
		</tr>
		<%
			List<CourseResource> crlist = CourseResourceDao
					.queryCourseResourceByUploaderID(session.getAttribute("session_userName").toString());
			for (CourseResource cr : crlist) {
		%>
		<tr>
			<td align="center"><input type="text" value=<%=cr.getCourseID()%>></td>
			<td align="center"><input type="text" value=<%=cr.getLabel()%>></td>
			<td align="center"><input type="text" value=<%=cr.getCourseName()%>></td>
			<td align="center"><input type="text" value=<%=cr.getUploaderID()%>></td>
			<td align="center"><input type="text" value=<%=cr.getUploadTime()%>></td>
			<td align="center"><input type="text" value=<%=cr.getFilePath()%>></td>
			<td align="center"><input type="text" value=<%=cr.getBriefIntroduce()%>></td>
			<td align="center"><a href="UploadServlet?opttype=delete&&CourseID=<%=cr.getCourseID()%>" style="text-decoration: none">删除</a></td>
		</tr>
		<%
			}
		%>
	</table> --%>
</body>
</html>